'use strict';
const { Controller } = require('egg');

class RegController extends Controller {
    async register() {
        const { ctx } = this;
        const params = ctx.request.body
        let res = await this.service.user.register(params)
        if (res.status) {
            ctx.body = {
                code: res.code,
                message: res.message,
                data: res.data
            }
        } else {
            ctx.body = {
                code: res.code,
                message: res.message,
                data: res.data
            }
        }

    }
}

module.exports = RegController;
